<html>
<head>
	<title>
		<? $sitename ?>
	</title>
	<style type="text/css" media="all">
		/* Table */
		table {
			border-collapse: collapse;
			width: 100%;
		}
		td, th {
			border: 1px solid black;
			padding: 0.1666em;
		}
	</style>
</head>
<body>

	<? include file=header.tpl ?>

	<table>
		<thead>
			<tr>
				<th>
					Directories
				</th>
			</tr>
		</thead>

		<tbody>
			<? if $is_root eq false ?>
				<tr>
					<td>
						<a href="<? $parent ?>">
							Go up a level
						</a>
					</td>
				</tr>
			<? /if ?>
		
			<? section loop=$directories name="dir" ?>
				<tr>
					<td>
						<a href="<? $directories[dir] ?>">
							<? $directories[dir] ?>
						</a>
					</td>
				</tr>
			<? sectionelse ?>
				<tr>
					<td>There are no sub-directories in this directory.</td>
				</tr>
			<? /section ?>
		</tbody>
	</table>

	<br />

	<table>
		<thead>
			<tr">
				<th>
					Files
				</th>
				<th>
					Download Links
				</th>
				<th>
					Downloaded
				</th>
			</tr>
		</thead>
	
		<tbody>
			<? foreach from=$downloads key="fname" item="dl" ?>
				<tr>
					<td>
						<? $dl.name ?>
					</td>
					<td>
						<? foreach from=$dl.downloads key="extention" item="file" ?>
							<a href="<? $fname ?><? $extention ?>">
								<? $extention ?>
							</a>
							<br />
						<? /foreach ?>
					</td>					
					<td>
						<? $dl.count ?>
					</td>
				</tr>
			<? foreachelse ?>
				<tr>
					<td colspan="3">
						There are no files in this directory.
					</td>
				</tr>
			<? /foreach ?>
		</tbody>
	</table>
	
	<? include file=footer.tpl ?>
	
</body>
</html>
